package org.eiahe.hr.attendance.service;

import org.eiahe.hr.attendance.domain.bo.AnnualLeaveAdjustBo;
import org.eiahe.hr.attendance.domain.bo.AnnualLeaveBo;
import org.eiahe.hr.attendance.domain.vo.AnnualLeaveAdjustLogVo;
import org.eiahe.hr.attendance.domain.vo.AnnualLeaveVo;
import org.ehe.common.mybatis.core.page.PageQuery;
import org.ehe.common.mybatis.core.page.TableDataInfo;

import java.math.BigDecimal;
import java.util.Collection;
import java.util.List;

/**
 * 年假核算Service接口
 *
 * @author zhangnn
 */
public interface IAnnualLeaveService {

    /**
     * 查询年假核算
     */
    AnnualLeaveVo queryById(Long id);

    /**
     * 查询年假核算列表
     */
    TableDataInfo<AnnualLeaveVo> queryPageList(AnnualLeaveBo bo, PageQuery pageQuery);

    /**
     * 查询年假核算列表
     */
    List<AnnualLeaveVo> queryList(AnnualLeaveBo bo);

    /**
     * 新增年假核算
     */
    Boolean insertByBo(AnnualLeaveBo bo);

    /**
     * 修改年假核算
     */
    Boolean updateByBo(AnnualLeaveBo bo);

    /**
     * 校验并批量删除年假核算信息
     */
    Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);

    /**
     * 年度核算 - 为所有在职员工核算年假
     *
     * @param year 年份
     */
    void calculateAnnualLeaveForYear(Integer year);

    /**
     * 为单个员工核算年假
     *
     * @param employeeNo 工号
     * @param year 年份
     */
    void calculateAnnualLeaveForEmployee(String employeeNo, Integer year);

    /**
     * 手动调整年假天数
     *
     * @return 是否成功
     */
    Boolean adjustAnnualLeave(AnnualLeaveAdjustBo adjustBo);

    /**
     * 扣减年假天数(请假通过后调用)
     *
     * @param employeeNo 工号
     * @param year 年份
     * @param days 扣减天数
     * @return 是否成功
     */
    Boolean deductAnnualLeave(String employeeNo, Integer year, BigDecimal days);

    /**
     * 查询调整日志
     *
     * @param annualLeaveId 年假记录ID
     * @return 调整日志列表
     */
    List<AnnualLeaveAdjustLogVo> queryAdjustLogs(Long annualLeaveId);
}
